import Loadable from 'react-loadable';
import Loading from '@/components/Loading';
function asyncLoad(loader: () => Promise<any>) {
  return Loadable({
    loader,
    loading: props => {
      if (props.pastDelay) {
        return <Loading />;
      } else {
        return null;
      }
    },
    delay: 5000,
  });
}
const routeConfig: any = [
  { path: '/', exact: true, title: 'react-ts-demo', component: asyncLoad(() => import('../views/main')) },
  { path: '/test', exact: true, title: 'react-ts-demo-test', component: asyncLoad(() => import('../views/test')) },
];
export default routeConfig